package gamecenter.gc.service.Imp;

import gamecenter.gc.bean.Game;
import gamecenter.gc.mapper.User_Game_Mapper;
import gamecenter.gc.service.User_Game_Service;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class User_Game_Service_Imp implements User_Game_Service {
    @Resource
    private User_Game_Mapper user_game_mapper;


    public List<Game> get_all_Game_From_User(String name) {
        return user_game_mapper.get_all_Game_From_User(name);
    }

    @Override
    public void buy_Game(String user_name, String game_name) {
        user_game_mapper.buy_Game(user_name, game_name);
    }

    @Override
    public boolean has_Game(String user_name, String game_name) {
        Game game = user_game_mapper.get_Cer_Game(user_name, game_name);
        return game != null;
    }

    @Override
    public void del_Game(String user_name, String game_name) {
        user_game_mapper.del_Game(user_name, game_name);
    }


}
